package com.seashop.feign;

import com.seashop.feign.fallback.ThirdFeignClientFallBack;
import com.seashop.request.GoogleTransRequestParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author moredln
 * @desc 三方接口feign调用
 * @date 2020-08-11 14:20
 */
@FeignClient(value = "third", fallback = ThirdFeignClientFallBack.class)
public interface ThirdFeignClient {

    @PostMapping("/google/batchTrans")
    String batchTrans(@RequestBody GoogleTransRequestParam param);

    @GetMapping("/google/trans")
    String googleTrans(@RequestParam("text") String text, @RequestParam("fromLanguageType") String fromLanguageType, @RequestParam("toLanguageType") String toLanguageType);
}
